package com.aprivate.kn.ratingsystem.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.aprivate.kn.ratingsystem.bean.DataOfProductList;

import java.util.List;

/**
 * Created by kenan on 2018/11/20.
 */

public class ProjectListAdapter extends BaseAdapter {
    List<DataOfProductList.ProductInfoBean> jsonListObject;

    private Context context;

    public ProjectListAdapter(Context _context, List<DataOfProductList.ProductInfoBean> jsonListObject) {
        context = _context;
        this.jsonListObject = jsonListObject;
    }

    @Override
    public int getCount() {
        return jsonListObject == null ? 0 : jsonListObject.size();
    }

    @Override
    public Object getItem(int i) {
        return jsonListObject == null ? 0 : jsonListObject.get(i);
    }

    @Override
    public long getItemId(int i) {
        return jsonListObject == null ? 0 : Long.getLong(String.valueOf(jsonListObject.get(i).getId()));
    }

    public void addData(List<DataOfProductList.ProductInfoBean> productInfoBeans){
        jsonListObject.addAll(productInfoBeans);
    }
    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {

        return null;
    }
}
